package o;

import android.text.TextUtils;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

public class edn extends BaseSharedPref {
    private static edn ˊ = null;
    private long ˋ = ॱ("lastRepeatingTaskTime", 0);
    private long ˎ = ॱ("lastUserPauseTime", 0);
    private long ॱ = ʼ();

    public static synchronized edn ˋ() {
        edn o_edn;
        synchronized (edn.class) {
            if (ˊ == null) {
                ˊ = new edn();
            }
            o_edn = ˊ;
        }
        return o_edn;
    }

    private edn() {
    }

    public long ॱ() {
        return this.ˋ;
    }

    public void ˊ(long j) {
        this.ˋ = j;
        ˎ("lastRepeatingTaskTime", j);
    }

    public void ˎ() {
        long currentTimeMillis = System.currentTimeMillis();
        this.ˎ = currentTimeMillis;
        ˎ("lastUserPauseTime", currentTimeMillis);
    }

    public long ˏ() {
        return this.ˎ;
    }

    public long ˊ() {
        return this.ॱ;
    }

    public void ˋ(long j) {
        long ʼ = ʼ() + j;
        this.ॱ = ʼ;
        ˋ("preDownloadedSize", ᐝ() + "#" + ʼ);
    }

    private long ʼ() {
        long j = 0;
        Object ॱ = ॱ("preDownloadedSize", "");
        if (!TextUtils.isEmpty(ॱ)) {
            String[] split = ॱ.split("#");
            if (split.length == 2) {
                if (ᐝ().equals(split[0])) {
                    try {
                        j = Long.parseLong(split[1]);
                    } catch (NumberFormatException e) {
                        Logger.ˎ("BackgroundTaskCache", "can not get download fail times: " + e.toString());
                    }
                } else {
                    ʼ("preDownloadedSize");
                }
            }
        }
        return j;
    }

    private String ᐝ() {
        return new SimpleDateFormat("yyyyMMdd", Locale.US).format(new Date(System.currentTimeMillis()));
    }
}
